package tests;

import util.Pair;
import junit.framework.TestCase;

/**
 * Classe de testes para util.Pair
 * 
 * @author Gilliard
 *
 */
public class TestPair extends TestCase {

	Pair p = new Pair(1,5);
	
	/**
	 * Testa construtor / equals / gets / sets
	 *
	 */
	public void testPair() {
		Pair a = new Pair(1,5);
		Pair b = new Pair(2,5);
		Object o = new Object();
		assertEquals(p, a);
		assertFalse(p.equals(b));
		assertFalse(a.equals(b));
		a.setFstElm(100);
		a.setSndElm(200);
		assertEquals(a.getFstElm(), 100);
		assertEquals(a.getSndElm(), 200);
		assertFalse(p.equals(o));
	}
	
	/**
	 * Teste do método toString
	 *
	 */
	public void testToString() {
		assertEquals("(1, 5)",p.toString());
	}

}